<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<link href="css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/cbgcolor.js"></script>
<script type="text/javascript" src="js/changebgcolor.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function login() {
	var user_role = $('#user_role').val();
	var user_name = $('#user_name').val();
	var user_pass = $('#user_pass').val();
	//Jquery 代码
	var url = '/storage/release/login.do?d=' + new Date()
			+ '&user_role=' + user_role
			+ '&user_name=' + user_name
			+ '&user_pass=' + user_pass;

	$.getJSON(url, {}, function(data){
		// 分为三种权限，1_只有‘8’号权限，2_没有‘8’号权限，3有‘8’号权限及其他权限
		if(data!=-1&&data!=null){
			window.location.href = data+'/index.html';
		}else{
			alert("输入信息有误，请核实后输入！");
		}
	});
}
function bgcolorTo(obj,color){
	obj.style.background = color;
}
</script>
</head>
<body>
<div id="login">
  <div id="top">
    <div id="top_left">
      <img src="images/login_03.gif" />
    </div>
    <div id="top_center">
    </div>
  </div>
  <div id="center">
    <div id="center_left">
    </div>
    <div id="center_middle" >
      <center>
        <br/>
        <br/>
        <br/>
        <form action="javascript: login()" method="post" >
          <table width="60%">
            <tr>
              <td align="right">
                用&nbsp;户&nbsp;&nbsp;&nbsp;
              </td>
              <td width="70%">
                <input class="user_info" type="text" id="user_name" name="user_name" />
              </td>
            </tr>
            <tr>
              <td align="right">
                密&nbsp;码&nbsp;&nbsp;&nbsp;
              </td>
              <td>
                <input class="user_info" type="password" id="user_pass" name="user_pass" />
              </td>
            </tr>
            <tr>
              <td align="right">
                角&nbsp;色&nbsp;&nbsp;&nbsp;
              </td>
              <td>
                <select class="user_info" id="user_role" name="user_role">
                  <option value="manager">仓库管理员</option>
                  <option value="admin">系统管理员</option>
                </select>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <input type="submit" value="登录" onmouseover="bgcolorTo(this,'#c1ebff')" onmouseout="bgcolorTo(this,'#ebffff')" style="cursor:pointer; width: 60px; padding-top: 2px; background-color: #ebffff;"/>
                &nbsp;
                <input type="reset"  value="重置" onmouseover="bgcolorTo(this,'#c1ebff')" onmouseout="bgcolorTo(this,'#ebffff')" style="cursor:pointer; width: 60px; padding-top: 2px; background-color: #ebffff;"/>
              </td>
            </tr>
          </table>
        </form>
      </center>
    </div>
    <div id="center_right">
    </div>
  </div>
  <div id="down">
    <div id="down_left">
      <div id="inf">
        <span class="inf_text">版本信息</span> <span class="copyright">收获金属库存管理系统 2012 v2.0</span>
      </div>
    </div>
    <div id="down_center">
    </div>
  </div>
</div>
</body>
</html>
